package top.yuhaitao.core.log;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author ocean
 * @time 2018年8月4日下午5:18:25
 */

// 指定SpringJUnit4ClassRunner测试运行器
@RunWith(SpringJUnit4ClassRunner.class)

// 提供spring上下文环境
//@SpringBootTest

// 替代private Logger log = LoggerFactory.getLogger(LoggerTest.class);
// eclispe运行需要安装lombok插件
//@Slf4j
public class LoggerTest {
    private Logger log = LoggerFactory.getLogger(LoggerTest.class);

    @Test
    public void testLog() {
        log.debug("测试slf4j-log4j-debug------");
        log.info("测试slf4j-log4j-info------");
        log.error("测试slf4j-log4j-error------");

        throw new RuntimeException("报错啦");
    }

}
